﻿using System.Collections.Generic;

namespace com.foxmail.wyyuan1991.Assignment
{
    /// <summary>
    /// 费用矩阵
    /// </summary>
    public class CostMatrix
    {
        private Dictionary<IArc, double> _Dic = new Dictionary<IArc, double>();
        public double this[IArc a]
        {
            get
            {
                if (_Dic.ContainsKey(a))
                {
                    return _Dic[a];
                }else
                {
                    return double.MaxValue;
                }
            }
            set
            {
                if (!_Dic.ContainsKey(a)) _Dic.Add(a, double.MaxValue);
                _Dic[a] = value;
            }
        }
        public void Clear()
        {
            this._Dic.Clear();
        }
    }
}
